﻿{% extends 'base.html' %}

{% block body %}

    <!--============= Banner Section Starts Here =============-->
    <div class="hero-section bg_img style-three" data-background="../static/assets/images/banner/page-header.jpg">
        <div class="container">
            <div class="section-header cl-white">
                <h2 class="title">猜数字</h2>
            </div>
        </div>
    </div>
    <!--============= Banner Section Ends Here =============-->

    <!--============= Changelog Section Starts Here =============-->
    <section class="changelog-section padding-bottom mt--187 pos-rel">
        <div class="container">
            <div class="changelog-wrapper">
                <div class="changelog-item">
                    {% if session['chanses']== 10 %}
                    <p style="text-align: center">你有10次机会去猜出正确答案噢！</p>
                    {% else %}
                    <p style="text-align: center">你还剩{{ session['chances'] }}次机会，加油！</p>
                    {% endif %}
                    <div>
                        <h6 style="text-align: center">输入任一整数（0~1000）</h6>
                    </div>
                    <div>
                        {% for message in get_flashed_messages() %}
                        {{ message }}
                        {% endfor %}
                    </div>
                    <form method="POST" enctype="multipart/form-data">
                        <div class="form-group">
                            <input class="form-control" type="text" name="guess-number" onkeyup="value=value.replace(/[^\d]/g,'')">
                        </div>
                        <div class="form-group">
                            <button class="form-control">提交</button>
                        </div>
                    </form>
                </div>
                <div class="changelog-item" style="padding-left: 475px">
                    <a class="custom-button" href={{ url_for ('guess_numebr') }}>再来一次！</a>
                </div>
            </div>
        </div>
    </section>
    <!--============= Changelog Section Ends Here =============-->

{% endblock %}